package cn.healthlink.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;

/**
 * @author dengzhiyuan
 * @version 1.0
 * @time 2021/3/2 10:18
 */
@Aspect
public class AspectConfig {

	@Pointcut(value = "execution(* cn.healthlink.aspect..*.*test(..))")
	public void test(){}

	@Before(value = "test()")
	public void beforeAdvice(){
		System.out.println("before advice");
	}

	@After(value = "test()")
	public void afterAdvice(){
		System.out.println("after advice");
	}

	@Around(value = "test()")
	public void aroundAdvice(ProceedingJoinPoint joinPoint){
		System.out.println("around advice begin");
		try {
			joinPoint.proceed();
		} catch (Throwable throwable) {
			throwable.printStackTrace();
		}
		System.out.println("around advice end");
	}

}
